package com.webchat.common.enums;

import lombok.Getter;

@Getter
public enum RoleCodeEnum {

    AIBOT(0, "我的Ai助手"),

    USER(1, "普通用户"),

    ADMIN(2, "管理员"),

    BLACK(3, "黑名单"),

    GROUP(4, "群组"),

    ROBOT(5, "聊天机器人"),

    PUBLIC_ACCOUNT(6, "公众号"),

    SERVER_ACCOUNT(7, "服务号"),
    ;

    private Integer code;
    private String name;

    RoleCodeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static boolean isUserRole(Integer roleCode) {
        if (roleCode == null) {
            return false;
        }
        return USER.code.equals(roleCode) || ADMIN.code.equals(roleCode);
    }
}
